package com.nd.pojo.vo;



import lombok.Builder;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: project2mall
 * @description: 用户管理员模块列表 admin/admin/list?page=1&limit=20&sort=add_ti
 * @author: shit_code_builder
 * @create: 2021-06-04 20:20
 **/

public class AdminAuthVO extends ErrorAndErrno<AdminAuthVO.DataBean> {

    /**
     * errno : 0
     * data : {"total":6,"items":[{"id":9,"username":"Logic_Test","avatar":"'","roleIds":[1,2,3,10,11,12,13]},{"id":8,"username":"test123","avatar":"http://182.92.235.201:8083/wx/storage/fetch/w7u66sfunhn6hl39stqt.jpg","roleIds":[1]},{"id":7,"username":"Linusss","avatar":"http://182.92.235.201:8083/wx/storage/fetch/i2tq9i1ucpnt7nr2vk1y.jpg","roleIds":[1,2,11]},{"id":5,"username":"mall123","avatar":"'","roleIds":[2,3]},{"id":4,"username":"promotion123","avatar":"'","roleIds":[3]},{"id":1,"username":"admin123","avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif","roleIds":[1]}]}
     * errmsg : 成功
     */

    private long errno;
    private DataBean data;
    private String errmsg;
    @Override
    public long getErrno() {
        return errno;
    }
    @Override
    public void setErrno(long errno) {
        this.errno = errno;
    }
    @Override
    public DataBean getData() {
        return data;
    }
    @Override
    public void setData(DataBean data) {
        this.data = data;
    }
    @Override
    public String getErrmsg() {
        return errmsg;
    }
    @Override
    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public static class DataBean {
        /**
         * total : 6
         * items : [{"id":9,"username":"Logic_Test","avatar":"'","roleIds":[1,2,3,10,11,12,13]},{"id":8,"username":"test123","avatar":"http://182.92.235.201:8083/wx/storage/fetch/w7u66sfunhn6hl39stqt.jpg","roleIds":[1]},{"id":7,"username":"Linusss","avatar":"http://182.92.235.201:8083/wx/storage/fetch/i2tq9i1ucpnt7nr2vk1y.jpg","roleIds":[1,2,11]},{"id":5,"username":"mall123","avatar":"'","roleIds":[2,3]},{"id":4,"username":"promotion123","avatar":"'","roleIds":[3]},{"id":1,"username":"admin123","avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif","roleIds":[1]}]
         */

        private long total;
        private List<ItemsBean> items;

        public long getTotal() {
            return total;
        }

        public void setTotal(long total) {
            this.total = total;
        }

        public List<ItemsBean> getItems() {
            synchronized (this){
                if (items==null)
                 items=new ArrayList<ItemsBean>();
            }

            return items;
        }

        public void setItems(List<ItemsBean> items) {
            this.items = items;
        }


    }
    @Builder
    public static class ItemsBean {
        /**
         * id : 9
         * username : Logic_Test
         * avatar : '
         * roleIds : [1,2,3,10,11,12,13]
         */

        private int id;
        private String username;
        private String avatar;
        private Integer[] roleIds;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public Integer[] getRoleIds() {
            return roleIds;
        }

        public void setRoleIds(Integer[] roleIds) {
            this.roleIds = roleIds;
        }
    }
}